home *** CD-ROM | disk | FTP | other *** search
- /*******************************************************************************
- +
- + LEDA 2.1.1 11-15-1991
- +
- +
- + interval_set.h
- +
- +
- + Copyright (c) 1991 by Max-Planck-Institut fuer Informatik
- + Im Stadtwald, 6600 Saarbruecken, FRG
- + All rights reserved.
- +
- *******************************************************************************/
-
-
-
-
- #ifndef INTERVALL_SET_H
- #define INTERVALL_SET_H
-
- #include <LEDA/d2_dictionary.h>
-
- typedef dic2_item is_item;
-
- declare(list,is_item)
-
-
- declare3(d2_dictionary,real,real,ent)
-
-
- struct Interval_Set : public d2_dictionary(real,real,ent) {
-
- real left(is_item it) { return key1(it); }
- real right(is_item it){ return key2(it); }
-
- list(is_item) intersection(real, real);
-
- Interval_Set() {}
- ~Interval_Set() {}
- };
-
-
-
- #define interval_set(itype) name2(itype,interval_set)
-
-
- #define interval_setdeclare(itype)\
- \
- struct interval_set(itype) : public Interval_Set{\
- \
- itype inf(is_item it) { return itype(Interval_Set::inf(it)); }\
- \
- is_item insert(real x, real y, itype i)\
- { return Interval_Set::insert(x,y,Copy(i)); }\
- \
- void change_inf(is_item it, itype i)\
- { Interval_Set::change_inf(it,Copy(i)); }\
- \
- list(is_item) intersection(real x, real y)\
- { return Interval_Set::intersection(x,y); }\
- \
- interval_set(itype)() {}\
- ~interval_set(itype)() {}\
- };
-
- #define forall_is_items(i,D) forall_dic2_items(i,D)
-
- #endif
-
-